import { NestFactory } from '@nestjs/core';
import { Transport } from '@nestjs/microservices';
import { join } from 'path';
import { AppModule } from './app.module';
console.log(__dirname)
async function bootstrap() {
  const app = await NestFactory.create(
    AppModule,
  );
  app.connectMicroservice({
    transport: Transport.GRPC,
    options: {
      package: 'rpc',
      protoPath: join(__dirname, './rpc.proto'),
      url: '127.0.0.1:8888'
    },
  })
  app.startAllMicroservicesAsync()
  await app.listen(8080,'0.0.0.0',()=>{
    console.log("server is listern on http://127.0.0.1:8080")
    return
  })

}
bootstrap();
